#ifndef _CONNMGR_H_
#define _CONNMGR_H_

#include <stdlib.h>
#include <string.h>

struct sock_metadata {
  int sock; /* socket descriptor */
  int proto;/* Protocol used */
  int ip_version; /* IPv4 or IPv6 */
  int in_use;/* Is data transfer in progress currently */
  int mode;/* Uplink or downlink */
  char* data;/* data currently sent/received */
};

struct connection_manager {
  struct sock_metadata;
  struct connection_manager *next_socket;
};

typedef struct connection_manager connmgr;
typrdef struct sock_metadata sock_info;
/* initialise connection manager */
void init(connmgr* conn);

/* Add another socket to the exising manager. */
void add_connection(connmgr* conn, sock_info* sock);

/* Remove a connection from the exising manager */
void remove_connection(connmgr* conn, int sock_fd);
